package com.example.walletdemo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@ApiModel(value = "消费记录对象",description = "消费记录表")
public class Record {

    @ApiModelProperty("消费id")
    private int rid;

    @ApiModelProperty("金额")
    private double money;

    @ApiModelProperty("余额")
    private double balance;

 /*   1：表示消费
    2：表示退款
    3：表示充值
    4：表示体现*/
    @ApiModelProperty("类型")
    private String rType;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("用户id")
    private int wid;

    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getrType() {
        return rType;
    }

    public void setrType(String rType) {
        this.rType = rType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getWid() {
        return wid;
    }

    public void setWid(int wid) {
        this.wid = wid;
    }

    @Override
    public String toString() {
        return "Record{" +
                "rid=" + rid +
                ", money=" + money +
                ", balance=" + balance +
                ", rType='" + rType + '\'' +
                ", createTime=" + createTime +
                ", wid=" + wid +
                '}';
    }
}
